package top.hg.tool.modules.car.oil;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import top.hg.tool.modules.car.constant.RedisKeyConstant;

import java.util.List;

/**
 * created by skh on 2019/7/13
 */
@Slf4j
@Service
public class OilService extends ServiceImpl<OilDao,OilEntity>{

	@Cacheable(value = RedisKeyConstant.car_oil_list)
	public List<OilEntity> getOilList() {
		log.info("从数据库获取油价列表");
		EntityWrapper<OilEntity> wrapper = new EntityWrapper<>();
		List<OilEntity> oilEntityList = this.selectList(wrapper);
		return oilEntityList;
	}
}
